package com.zing.mapper;

import com.zing.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {

    // 通过openid获取用户信息
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);

    //插入用户
    void insert(User user);

    // 通过id获取用户信息
    @Select("select * from user where id = #{id}")
    User getById(Long id);

    // 根据时间区间, 查询用户数量
    Integer countByMap(Map map);
}
